{% extends "base.html" %}

{% block content %}
<h2>📦 我的订单</h2>
{% if orders %}
    <div class="list-group">
        {% for order in orders %}
            <div class="list-group-item list-group-item-action">
                <div class="d-flex w-100 justify-content-between">
                    <h5 class="mb-1">订单 #{{ order.id }}</h5>
                    <small>{{ order.created_at.strftime('%Y-%m-%d %H:%M') }}</small>
                </div>
                <p class="mb-1">总计：¥{{ order.total_amount }}</p>
                <small>状态：{{ order.status }}</small>
            </div>
        {% endfor %}
    </div>
{% else %}
    <div class="text-center py-5">
        <p class="h4">暂无订单</p>
        <a href="{{ url_for('index') }}" class="btn btn-primary">去购物</a>
    </div>
{% endif %}
{% endblock %}